package org.linlinjava.litemall.db.util;

import org.linlinjava.litemall.db.domain.LitemallRentOrder;

/**
 * @author Administrator
 */
public class RentOrderConstant {
    /**
     * 租书待发货
     */
    public static final Integer STATUS_WAIT = 1;
    /**
     * 租书已发货
     */
    public static final Integer STATUS_SHIP = 2;
    /**
     * 租书已收货
     */
    public static final Integer STATUS_CONFIRM = 3;
    /**
     * 还书待发货
     */
    public static final Integer STATUS_RETURN_WAIT = 4;
    /**
     * 还书已发货
     */
    public static final Integer STATUS_RETURN_SHIP = 5;
    /**
     * 确认还书
     */
    public static final Integer STATUS_CONFIRM_RETURN = 6;
    /**
     * 已取消
     */
    public static final Integer STATUS_CANCEL = 7;
    /**
     * 部分还书中
     */
    public static final Integer PART_RETURN = 8;
    /**
     * 部分还书完成
     */
    public static final Integer PART_RETURN_FINISH = 9;

    public static String rentOrderStatusText(LitemallRentOrder rentOrder) {
        int status = rentOrder.getRentOrderStatus();

        switch (status) {
            case 1:
                return "租书待发货";
            case 2:
                return "租书已发货";
            case 3:
                return "租书已收货";
            case 4:
                return "还书待发货";
            case 5:
                return "还书已发货";
            case 6:
                return "还书已收货";
            case 7:
                return "已取消";
            case 8:
                return "部分还书中";
            case 9:
                return "部分还书完成";
            default:
                throw new IllegalStateException("orderStatus不支持");
        }


    }
}
